import { axiosLogin } from '@/service/request.js'
import { ref, reactive, computed, watch } from 'vue'
export default (data) => {
	const list = ref([]) //gqge
	const details = ref({})
	const page = ref(1)
	const size = ref(10)

	const sumComputed = computed(() => {
		return list.value.map(item => {
			return item.status
		})
	})
	const getLoginAction = async (url, params) => {
		const __data = await axiosLogin(url, params)
		return __data
	}
	//获取验证码接口
	const getVerificationCode = async (url, params) => {
		const __data = await axiosLogin(url, params)
		return __data
	}
	//获取手机验证码
	const getPhoneCode = async (url, params) => {
		const __data = await axiosLogin(url, params)
		return __data
	}

	//用户注册接口
	const userRegister = async (url, params) => {
		const __data = await axiosLogin(url, params)
		return __data
	}

	//重置密码接口
	const resetPassWord = async (url, params) => {
		const __data = await axiosLogin(url, params)
		return __data
	}
	return {
		list,
		details,
		page,
		size,
		sumComputed,
		getLoginAction,
		getVerificationCode,
		userRegister,
		resetPassWord,
		getPhoneCode
	}
}